#ifndef __TEXTMENU_H__
#define __TEXTMENU_H__

#include "u8g2.h"

u8g2_t u8g2;

#define MAX_MENU                4
#define TEXT_HEIGHT             16
#define BOX_HEIGHT              TEXT_HEIGHT + 2
#define LCD_WIDTH               128
#define MENUS_IN_ONEPAGE        4                   // (16 pixel height for menu text)

typedef unsigned char (*pFunc)(void);
typedef void(*pFuncArray[])(void);

typedef struct _textMenu_t {
    char *pTmenuList[MAX_MENU];
    unsigned char textMenuSize;
    char curMenuID;
    pFunc KeyUpCheck;
    pFunc KeyUpCallback;
    pFunc KeyDownCheck;
    pFunc KeyDownCallback;
    pFunc KeySelectCheck;
    pFuncArray KeySelectCallback;
} textMenu_t, *pTextMenu_t;

textMenu_t textMenu;

void textMenu_Init(pTextMenu_t pTextMenu);
void textMenu_Handle(pTextMenu_t pTextMenu);

#endif

